<template>
  <div class="alarm-notify">
    <div v-for="(item,index) in notifyList" :key="index" class="notify">
      <div class="notify-title text-color">
        <span>{{ item.alarmLabel }}</span>
        <i class="el-icon-close text-color" @click="closeNotify(item)" />
      </div>
      <div class=" font-small text-color">
        {{ $t('ALARM_SITE') }}：{{ item.regionList.map(i => i.regionName).join('/') }}
      </div>
      <div class=" font-small text-color">
        {{ $t('ALARM_TYPE') }}：{{ dictMap['ALARM_TYPE'][item.alarmType] }}
      </div>
      <div class=" font-small text-color">
        {{ $t('ALARM_DEVICE') }}：{{ item.device? item.device.deviceName : item.deviceId }}
      </div>
      <div v-if="item.bizModule !== 'PEM'" class=" font-small text-color">
        {{ $t('ALARM_TIME') }}：{{ item.startTime }}
      </div>
      <div class=" font-small text-color">
        {{ $t('ALARM_DESCRIPTION') }}：{{ item.description }}
      </div>
    </div>
  </div>
</template>
<script>
  import { mapGetters } from 'vuex'
  export default {
    data() {
      return {

      }
    },
    computed: {
      ...mapGetters(['notifyList', 'dictMap'])
    },
    methods: {
      closeNotify(data) {
        this.$store.commit('REMOVE_NOTIFY_LIST', data)
      }
    }
  }
</script>
<style lang="scss">
  @import 'src/assets/css/mixin.module';

.alarm-notify {
  position: fixed;
  padding: 0 16px 16px 0;
  right: 0;
  bottom: 0;
  width: 330px;
  max-height: 100vh;
  overflow: auto;
  z-index: 999;

  .notify {
    margin-top: 10px;
    padding: 14px 13px;
    border-radius: 8px;

  @include themeify {
    background: themed("tableBgTrColor");
    border: 1px solid themed("borderColor");
  }
  .notify-title {
    padding: 0 0 5px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: 700;
  }
}
}
</style>
